#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int sum[80] = { 0 };
	int ji[80];
	int ou[80];
	int i = 0;
	int j = 0;
	int k = 0;
	int mid = 0;
	for (i = 0; i < 10; i++)
	{
		scanf("%d", &sum[i]);
		if (sum[i] % 2 == 0)
			ou[j++] = sum[i];
		else
			ji[k++] = sum[i];
	}
	int j1 = 0;
	int k1 = 0;
	for (i = 0; i < 10; i++)
	{
		if (mid != k)
		{
			sum[i] = ji[k1++];
			mid++;
		}
		else
			sum[i] = ou[j1++];
		printf("%d ", sum[i]);
	}
	return 0;
}